Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in vector. This patch cleans up all usages of the following feature test macros inside <vector> and its tests: * _LIBCPP_HAS_NO_RVALUE_REFERENCES * _LIBCPP_HAS_NO_VARIADICS * _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS Where needed the above guards were replaced with _LIBCPP_CXX03_LANG. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300410 91177308-0d34-0410-b5e6-96231b3b80d8 
diff --git a/include/vector b/include/vector index 8f404dc..6759dbd 100644 --- a/include/vector +++ b/include/vector 
@@ -527,12 +527,7 @@  is_constructible<  value_type,  typename iterator_traits<_ForwardIterator>::reference>::value>::type* = 0); -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS - _LIBCPP_INLINE_VISIBILITY - vector(initializer_list<value_type> __il); - _LIBCPP_INLINE_VISIBILITY - vector(initializer_list<value_type> __il, const allocator_type& __a); -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +  #if _LIBCPP_DEBUG_LEVEL >= 2  _LIBCPP_INLINE_VISIBILITY  ~vector() @@ -545,7 +540,14 @@  vector(const vector& __x, const allocator_type& __a);  _LIBCPP_INLINE_VISIBILITY  vector& operator=(const vector& __x); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES + +#ifndef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY + vector(initializer_list<value_type> __il); + + _LIBCPP_INLINE_VISIBILITY + vector(initializer_list<value_type> __il, const allocator_type& __a); +  _LIBCPP_INLINE_VISIBILITY  vector(vector&& __x)  #if _LIBCPP_STD_VER > 14 @@ -553,17 +555,18 @@  #else  _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);  #endif +  _LIBCPP_INLINE_VISIBILITY  vector(vector&& __x, const allocator_type& __a);  _LIBCPP_INLINE_VISIBILITY  vector& operator=(vector&& __x)  _NOEXCEPT_((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value)); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +  _LIBCPP_INLINE_VISIBILITY  vector& operator=(initializer_list<value_type> __il)  {assign(__il.begin(), __il.end()); return *this;} -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS + +#endif // !_LIBCPP_CXX03_LANG    template <class _InputIterator>  typename enable_if @@ -588,11 +591,12 @@  assign(_ForwardIterator __first, _ForwardIterator __last);    void assign(size_type __n, const_reference __u); -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS + +#ifndef _LIBCPP_CXX03_LANG  _LIBCPP_INLINE_VISIBILITY  void assign(initializer_list<value_type> __il)  {assign(__il.begin(), __il.end());} -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif    _LIBCPP_INLINE_VISIBILITY  allocator_type get_allocator() const _NOEXCEPT @@ -676,9 +680,10 @@  {return _VSTD::__to_raw_pointer(this->__begin_);}    _LIBCPP_INLINE_VISIBILITY void push_back(const_reference __x); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES + +#ifndef _LIBCPP_CXX03_LANG  _LIBCPP_INLINE_VISIBILITY void push_back(value_type&& __x); -#ifndef _LIBCPP_HAS_NO_VARIADICS +  template <class... _Args>  _LIBCPP_INLINE_VISIBILITY  #if _LIBCPP_STD_VER > 14 @@ -686,19 +691,19 @@  #else  void emplace_back(_Args&&... __args);  #endif -#endif // _LIBCPP_HAS_NO_VARIADICS -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // !_LIBCPP_CXX03_LANG +  _LIBCPP_INLINE_VISIBILITY  void pop_back();    iterator insert(const_iterator __position, const_reference __x); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES + +#ifndef _LIBCPP_CXX03_LANG  iterator insert(const_iterator __position, value_type&& __x); -#ifndef _LIBCPP_HAS_NO_VARIADICS  template <class... _Args>  iterator emplace(const_iterator __position, _Args&&... __args); -#endif // _LIBCPP_HAS_NO_VARIADICS -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // !_LIBCPP_CXX03_LANG +  iterator insert(const_iterator __position, size_type __n, const_reference __x);  template <class _InputIterator>  typename enable_if @@ -721,11 +726,12 @@  iterator  >::type  insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last); -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS + +#ifndef _LIBCPP_CXX03_LANG  _LIBCPP_INLINE_VISIBILITY  iterator insert(const_iterator __position, initializer_list<value_type> __il)  {return insert(__position, __il.begin(), __il.end());} -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif    _LIBCPP_INLINE_VISIBILITY iterator erase(const_iterator __position);  iterator erase(const_iterator __first, const_iterator __last); @@ -798,18 +804,16 @@  __base::__destruct_at_end(__new_last);  __annotate_shrink(__old_size);  } - template <class _Up> - void -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - __push_back_slow_path(_Up&& __x); -#else - __push_back_slow_path(_Up& __x); -#endif -#if !defined(_LIBCPP_HAS_NO_VARIADICS) && !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) + +#ifndef _LIBCPP_CXX03_LANG + template <class _Up> void __push_back_slow_path(_Up&& __x); +  template <class... _Args> - void - __emplace_back_slow_path(_Args&&... __args); + void __emplace_back_slow_path(_Args&&... __args); +#else + template <class _Up> void __push_back_slow_path(_Up& __x);  #endif +  // The following functions are no-ops outside of AddressSanitizer mode.  // We call annotatations only for the default Allocator because other allocators  // may not meet the AddressSanitizer alignment constraints. @@ -1219,7 +1223,7 @@  }  }   -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG    template <class _Tp, class _Allocator>  inline _LIBCPP_INLINE_VISIBILITY @@ -1266,8 +1270,6 @@  }  }   -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS -  template <class _Tp, class _Allocator>  inline _LIBCPP_INLINE_VISIBILITY  vector<_Tp, _Allocator>::vector(initializer_list<value_type> __il) @@ -1297,8 +1299,6 @@  }  }   -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS -  template <class _Tp, class _Allocator>  inline _LIBCPP_INLINE_VISIBILITY  vector<_Tp, _Allocator>& @@ -1340,7 +1340,7 @@  #endif  }   -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // !_LIBCPP_CXX03_LANG    template <class _Tp, class _Allocator>  inline _LIBCPP_INLINE_VISIBILITY @@ -1562,7 +1562,7 @@  template <class _Tp, class _Allocator>  template <class _Up>  void -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG  vector<_Tp, _Allocator>::__push_back_slow_path(_Up&& __x)  #else  vector<_Tp, _Allocator>::__push_back_slow_path(_Up& __x) @@ -1593,7 +1593,7 @@  __push_back_slow_path(__x);  }   -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG    template <class _Tp, class _Allocator>  inline _LIBCPP_INLINE_VISIBILITY @@ -1613,8 +1613,6 @@  __push_back_slow_path(_VSTD::move(__x));  }   -#ifndef _LIBCPP_HAS_NO_VARIADICS -  template <class _Tp, class _Allocator>  template <class... _Args>  void @@ -1654,8 +1652,7 @@  #endif  }   -#endif // _LIBCPP_HAS_NO_VARIADICS -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // !_LIBCPP_CXX03_LANG    template <class _Tp, class _Allocator>  inline @@ -1760,7 +1757,7 @@  return __make_iter(__p);  }   -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG    template <class _Tp, class _Allocator>  typename vector<_Tp, _Allocator>::iterator @@ -1799,8 +1796,6 @@  return __make_iter(__p);  }   -#ifndef _LIBCPP_HAS_NO_VARIADICS -  template <class _Tp, class _Allocator>  template <class... _Args>  typename vector<_Tp, _Allocator>::iterator @@ -1840,8 +1835,7 @@  return __make_iter(__p);  }   -#endif // _LIBCPP_HAS_NO_VARIADICS -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // !_LIBCPP_CXX03_LANG    template <class _Tp, class _Allocator>  typename vector<_Tp, _Allocator>::iterator @@ -2038,7 +2032,7 @@  _VSTD::swap(this->__begin_, __x.__begin_);  _VSTD::swap(this->__end_, __x.__end_);  _VSTD::swap(this->__end_cap(), __x.__end_cap()); - __swap_allocator(this->__alloc(), __x.__alloc(),  + __swap_allocator(this->__alloc(), __x.__alloc(),  integral_constant<bool,__alloc_traits::propagate_on_container_swap::value>());  #if _LIBCPP_DEBUG_LEVEL >= 2  __get_db()->swap(this, &__x); @@ -2233,12 +2227,11 @@  vector(const vector& __v);  vector(const vector& __v, const allocator_type& __a);  vector& operator=(const vector& __v); -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS + +#ifndef _LIBCPP_CXX03_LANG  vector(initializer_list<value_type> __il);  vector(initializer_list<value_type> __il, const allocator_type& __a); -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS   -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES  _LIBCPP_INLINE_VISIBILITY  vector(vector&& __v)  #if _LIBCPP_STD_VER > 14 @@ -2250,12 +2243,12 @@  _LIBCPP_INLINE_VISIBILITY  vector& operator=(vector&& __v)  _NOEXCEPT_((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value)); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +  _LIBCPP_INLINE_VISIBILITY  vector& operator=(initializer_list<value_type> __il)  {assign(__il.begin(), __il.end()); return *this;} -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS + +#endif // !_LIBCPP_CXX03_LANG    template <class _InputIterator>  typename enable_if @@ -2274,11 +2267,12 @@  assign(_ForwardIterator __first, _ForwardIterator __last);    void assign(size_type __n, const value_type& __x); -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS + +#ifndef _LIBCPP_CXX03_LANG  _LIBCPP_INLINE_VISIBILITY  void assign(initializer_list<value_type> __il)  {assign(__il.begin(), __il.end());} -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif    _LIBCPP_INLINE_VISIBILITY allocator_type get_allocator() const _NOEXCEPT  {return allocator_type(this->__alloc());} @@ -2387,11 +2381,12 @@  iterator  >::type  insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last); -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS + +#ifndef _LIBCPP_CXX03_LANG  _LIBCPP_INLINE_VISIBILITY  iterator insert(const_iterator __position, initializer_list<value_type> __il)  {return insert(__position, __il.begin(), __il.end());} -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif    _LIBCPP_INLINE_VISIBILITY iterator erase(const_iterator __position);  iterator erase(const_iterator __first, const_iterator __last); @@ -2751,7 +2746,7 @@  }  }   -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#ifndef _LIBCPP_CXX03_LANG    template <class _Allocator>  vector<bool, _Allocator>::vector(initializer_list<value_type> __il) @@ -2781,7 +2776,7 @@  }  }   -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG    template <class _Allocator>  vector<bool, _Allocator>::~vector() @@ -2838,7 +2833,7 @@  return *this;  }   -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG    template <class _Allocator>  inline _LIBCPP_INLINE_VISIBILITY @@ -2913,7 +2908,7 @@  __c.__cap() = __c.__size_ = 0;  }   -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // !_LIBCPP_CXX03_LANG    template <class _Allocator>  void @@ -3203,7 +3198,7 @@  _VSTD::swap(this->__begin_, __x.__begin_);  _VSTD::swap(this->__size_, __x.__size_);  _VSTD::swap(this->__cap(), __x.__cap()); - __swap_allocator(this->__alloc(), __x.__alloc(),  + __swap_allocator(this->__alloc(), __x.__alloc(),  integral_constant<bool, __alloc_traits::propagate_on_container_swap::value>());  }   
diff --git a/test/std/containers/sequences/vector.bool/assign_initializer_list.pass.cpp b/test/std/containers/sequences/vector.bool/assign_initializer_list.pass.cpp index ac7a2ce..60146a8 100644 --- a/test/std/containers/sequences/vector.bool/assign_initializer_list.pass.cpp +++ b/test/std/containers/sequences/vector.bool/assign_initializer_list.pass.cpp 
@@ -7,6 +7,8 @@  //  //===----------------------------------------------------------------------===//   +// UNSUPPORTED: c++98, c++03 +  // <vector>    // void assign(initializer_list<value_type> il); @@ -18,7 +20,6 @@    int main()  { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS  {  std::vector<bool> d;  d.assign({true, false, false, true}); @@ -28,7 +29,6 @@  assert(d[2] == false);  assert(d[3] == true);  } -#if TEST_STD_VER >= 11  {  std::vector<bool, min_allocator<bool>> d;  d.assign({true, false, false, true}); @@ -38,6 +38,4 @@  assert(d[2] == false);  assert(d[3] == true);  } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS  } 
diff --git a/test/std/containers/sequences/vector.bool/assign_move.pass.cpp b/test/std/containers/sequences/vector.bool/assign_move.pass.cpp index f07c1d9..13cd65f 100644 --- a/test/std/containers/sequences/vector.bool/assign_move.pass.cpp +++ b/test/std/containers/sequences/vector.bool/assign_move.pass.cpp 
@@ -7,6 +7,8 @@  //  //===----------------------------------------------------------------------===//   +// UNSUPPORTED: c++98, c++03 +  // <vector>    // vector& operator=(vector&& c); @@ -18,7 +20,6 @@    int main()  { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES  {  std::vector<bool, test_allocator<bool> > l(test_allocator<bool>(5));  std::vector<bool, test_allocator<bool> > lo(test_allocator<bool>(5)); @@ -61,7 +62,6 @@  assert(l.empty());  assert(l2.get_allocator() == lo.get_allocator());  } -#if TEST_STD_VER >= 11  {  std::vector<bool, min_allocator<bool> > l(min_allocator<bool>{});  std::vector<bool, min_allocator<bool> > lo(min_allocator<bool>{}); @@ -76,6 +76,4 @@  assert(l.empty());  assert(l2.get_allocator() == lo.get_allocator());  } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES  } 
diff --git a/test/std/containers/sequences/vector.bool/initializer_list.pass.cpp b/test/std/containers/sequences/vector.bool/initializer_list.pass.cpp index 07bae0e..a850fa2 100644 --- a/test/std/containers/sequences/vector.bool/initializer_list.pass.cpp +++ b/test/std/containers/sequences/vector.bool/initializer_list.pass.cpp 
@@ -7,6 +7,8 @@  //  //===----------------------------------------------------------------------===//   +// UNSUPPORTED: c++98, c++03 +  // <vector>    // vector(initializer_list<value_type> il); @@ -18,7 +20,6 @@    int main()  { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS  {  std::vector<bool> d = {true, false, false, true};  assert(d.size() == 4); @@ -27,7 +28,6 @@  assert(d[2] == false);  assert(d[3] == true);  } -#if TEST_STD_VER >= 11  {  std::vector<bool, min_allocator<bool>> d = {true, false, false, true};  assert(d.size() == 4); @@ -36,6 +36,4 @@  assert(d[2] == false);  assert(d[3] == true);  } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS  } 
diff --git a/test/std/containers/sequences/vector.bool/initializer_list_alloc.pass.cpp b/test/std/containers/sequences/vector.bool/initializer_list_alloc.pass.cpp index 5f7f514..9a2df42 100644 --- a/test/std/containers/sequences/vector.bool/initializer_list_alloc.pass.cpp +++ b/test/std/containers/sequences/vector.bool/initializer_list_alloc.pass.cpp 
@@ -7,6 +7,8 @@  //  //===----------------------------------------------------------------------===//   +// UNSUPPORTED: c++98, c++03 +  // <vector>    // vector(initializer_list<value_type> il, const Allocator& a = allocator_type()); @@ -19,7 +21,6 @@    int main()  { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS  {  std::vector<bool, test_allocator<bool>> d({true, false, false, true}, test_allocator<bool>(3));  assert(d.get_allocator() == test_allocator<bool>(3)); @@ -29,7 +30,6 @@  assert(d[2] == false);  assert(d[3] == true);  } -#if TEST_STD_VER >= 11  {  std::vector<bool, min_allocator<bool>> d({true, false, false, true}, min_allocator<bool>());  assert(d.get_allocator() == min_allocator<bool>()); @@ -39,6 +39,4 @@  assert(d[2] == false);  assert(d[3] == true);  } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS  } 
diff --git a/test/std/containers/sequences/vector.bool/insert_iter_initializer_list.pass.cpp b/test/std/containers/sequences/vector.bool/insert_iter_initializer_list.pass.cpp index 3a176d9..df4cb19 100644 --- a/test/std/containers/sequences/vector.bool/insert_iter_initializer_list.pass.cpp +++ b/test/std/containers/sequences/vector.bool/insert_iter_initializer_list.pass.cpp 
@@ -7,6 +7,8 @@  //  //===----------------------------------------------------------------------===//   +// UNSUPPORTED: c++98, c++03 +  // <vector>    // iterator insert(const_iterator p, initializer_list<value_type> il); @@ -18,7 +20,6 @@    int main()  { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS  {  std::vector<bool> d(10, true);  std::vector<bool>::iterator i = d.insert(d.cbegin() + 2, {false, true, true, false}); @@ -39,7 +40,6 @@  assert(d[12] == true);  assert(d[13] == true);  } -#if TEST_STD_VER >= 11  {  std::vector<bool, min_allocator<bool>> d(10, true);  std::vector<bool, min_allocator<bool>>::iterator i = d.insert(d.cbegin() + 2, {false, true, true, false}); @@ -60,6 +60,4 @@  assert(d[12] == true);  assert(d[13] == true);  } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS  } 
diff --git a/test/std/containers/sequences/vector.bool/move.pass.cpp b/test/std/containers/sequences/vector.bool/move.pass.cpp index f3a11ec..f189e2b 100644 --- a/test/std/containers/sequences/vector.bool/move.pass.cpp +++ b/test/std/containers/sequences/vector.bool/move.pass.cpp 
@@ -7,6 +7,8 @@  //  //===----------------------------------------------------------------------===//   +// UNSUPPORTED: c++98, c++03 +  // <vector>    // vector(vector&& c); @@ -18,7 +20,6 @@    int main()  { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES  {  std::vector<bool, test_allocator<bool> > l(test_allocator<bool>(5));  std::vector<bool, test_allocator<bool> > lo(test_allocator<bool>(5)); @@ -45,7 +46,6 @@  assert(l.empty());  assert(l2.get_allocator() == lo.get_allocator());  } -#if TEST_STD_VER >= 11  {  std::vector<bool, min_allocator<bool> > l(min_allocator<bool>{});  std::vector<bool, min_allocator<bool> > lo(min_allocator<bool>{}); @@ -59,6 +59,4 @@  assert(l.empty());  assert(l2.get_allocator() == lo.get_allocator());  } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES  } 
diff --git a/test/std/containers/sequences/vector.bool/move_alloc.pass.cpp b/test/std/containers/sequences/vector.bool/move_alloc.pass.cpp index 7aaa7c5..b3b6f96 100644 --- a/test/std/containers/sequences/vector.bool/move_alloc.pass.cpp +++ b/test/std/containers/sequences/vector.bool/move_alloc.pass.cpp 
@@ -7,6 +7,8 @@  //  //===----------------------------------------------------------------------===//   +// UNSUPPORTED: c++98, c++03 +  // <vector>    // vector(vector&& c, const allocator_type& a); @@ -18,7 +20,6 @@    int main()  { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES  {  std::vector<bool, test_allocator<bool> > l(test_allocator<bool>(5));  std::vector<bool, test_allocator<bool> > lo(test_allocator<bool>(5)); @@ -58,7 +59,6 @@  assert(!l.empty());  assert(l2.get_allocator() == other_allocator<bool>(4));  } -#if TEST_STD_VER >= 11  {  std::vector<bool, min_allocator<bool> > l(min_allocator<bool>{});  std::vector<bool, min_allocator<bool> > lo(min_allocator<bool>{}); @@ -72,6 +72,4 @@  assert(l.empty());  assert(l2.get_allocator() == min_allocator<bool>());  } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES  } 
diff --git a/test/std/containers/sequences/vector.bool/op_equal_initializer_list.pass.cpp b/test/std/containers/sequences/vector.bool/op_equal_initializer_list.pass.cpp index 4b959cf..6187433 100644 --- a/test/std/containers/sequences/vector.bool/op_equal_initializer_list.pass.cpp +++ b/test/std/containers/sequences/vector.bool/op_equal_initializer_list.pass.cpp 
@@ -7,6 +7,8 @@  //  //===----------------------------------------------------------------------===//   +// UNSUPPORTED: c++98, c++03 +  // <vector>    // vector& operator=(initializer_list<value_type> il); @@ -18,7 +20,6 @@    int main()  { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS  {  std::vector<bool> d;  d = {true, false, false, true}; @@ -28,7 +29,6 @@  assert(d[2] == false);  assert(d[3] == true);  } -#if TEST_STD_VER >= 11  {  std::vector<bool, min_allocator<bool>> d;  d = {true, false, false, true}; @@ -38,6 +38,4 @@  assert(d[2] == false);  assert(d[3] == true);  } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS  } 
diff --git a/test/std/containers/sequences/vector/vector.capacity/resize_size.pass.cpp b/test/std/containers/sequences/vector/vector.capacity/resize_size.pass.cpp index 6409aca..273bdad 100644 --- a/test/std/containers/sequences/vector/vector.capacity/resize_size.pass.cpp +++ b/test/std/containers/sequences/vector/vector.capacity/resize_size.pass.cpp 
@@ -13,6 +13,8 @@    #include <vector>  #include <cassert> + +#include "test_macros.h"  #include "test_allocator.h"  #include "MoveOnly.h"  #include "min_allocator.h" @@ -20,31 +22,6 @@    int main()  { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - { - std::vector<MoveOnly> v(100); - v.resize(50); - assert(v.size() == 50); - assert(v.capacity() == 100); - assert(is_contiguous_container_asan_correct(v)); - v.resize(200); - assert(v.size() == 200); - assert(v.capacity() >= 200); - assert(is_contiguous_container_asan_correct(v)); - } - { - // Add 1 for implementations that dynamically allocate a container proxy. - std::vector<MoveOnly, limited_allocator<MoveOnly, 300 + 1> > v(100); - v.resize(50); - assert(v.size() == 50); - assert(v.capacity() == 100); - assert(is_contiguous_container_asan_correct(v)); - v.resize(200); - assert(v.size() == 200); - assert(v.capacity() >= 200); - assert(is_contiguous_container_asan_correct(v)); - } -#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES  {  std::vector<int> v(100);  v.resize(50); @@ -68,9 +45,31 @@  assert(v.capacity() >= 200);  assert(is_contiguous_container_asan_correct(v));  } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES  #if TEST_STD_VER >= 11  { + std::vector<MoveOnly> v(100); + v.resize(50); + assert(v.size() == 50); + assert(v.capacity() == 100); + assert(is_contiguous_container_asan_correct(v)); + v.resize(200); + assert(v.size() == 200); + assert(v.capacity() >= 200); + assert(is_contiguous_container_asan_correct(v)); + } + { + // Add 1 for implementations that dynamically allocate a container proxy. + std::vector<MoveOnly, limited_allocator<MoveOnly, 300 + 1> > v(100); + v.resize(50); + assert(v.size() == 50); + assert(v.capacity() == 100); + assert(is_contiguous_container_asan_correct(v)); + v.resize(200); + assert(v.size() == 200); + assert(v.capacity() >= 200); + assert(is_contiguous_container_asan_correct(v)); + } + {  std::vector<MoveOnly, min_allocator<MoveOnly>> v(100);  v.resize(50);  assert(v.size() == 50); 
diff --git a/test/std/containers/sequences/vector/vector.cons/assign_initializer_list.pass.cpp b/test/std/containers/sequences/vector/vector.cons/assign_initializer_list.pass.cpp index 222fa9c..853f755 100644 --- a/test/std/containers/sequences/vector/vector.cons/assign_initializer_list.pass.cpp +++ b/test/std/containers/sequences/vector/vector.cons/assign_initializer_list.pass.cpp 
@@ -7,6 +7,8 @@  //  //===----------------------------------------------------------------------===//   +// UNSUPPORTED: c++98, c++03 +  // <vector>    // void assign(initializer_list<value_type> il); @@ -20,7 +22,6 @@  template <typename Vec>  void test ( Vec &v )  { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS  v.assign({3, 4, 5, 6});  assert(v.size() == 4);  assert(is_contiguous_container_asan_correct(v)); @@ -28,7 +29,6 @@  assert(v[1] == 4);  assert(v[2] == 5);  assert(v[3] == 6); -#endif  }    int main() @@ -41,8 +41,6 @@  test(d1);  test(d2);  } - -#if TEST_STD_VER >= 11  {  typedef std::vector<int, min_allocator<int>> V;  V d1; @@ -51,5 +49,4 @@  test(d1);  test(d2);  } -#endif  } 
diff --git a/test/std/containers/sequences/vector/vector.cons/assign_move.pass.cpp b/test/std/containers/sequences/vector/vector.cons/assign_move.pass.cpp index acbee97..c2b6b83 100644 --- a/test/std/containers/sequences/vector/vector.cons/assign_move.pass.cpp +++ b/test/std/containers/sequences/vector/vector.cons/assign_move.pass.cpp 
@@ -7,6 +7,8 @@  //  //===----------------------------------------------------------------------===//   +// UNSUPPORTED: c++98, c++03 +  // <vector>    // vector& operator=(vector&& c); @@ -20,7 +22,6 @@    int main()  { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES  {  std::vector<MoveOnly, test_allocator<MoveOnly> > l(test_allocator<MoveOnly>(5));  std::vector<MoveOnly, test_allocator<MoveOnly> > lo(test_allocator<MoveOnly>(5)); @@ -76,7 +77,6 @@  assert(l2.get_allocator() == lo.get_allocator());  assert(is_contiguous_container_asan_correct(l2));  } -#if TEST_STD_VER >= 11  {  std::vector<MoveOnly, min_allocator<MoveOnly> > l(min_allocator<MoveOnly>{});  std::vector<MoveOnly, min_allocator<MoveOnly> > lo(min_allocator<MoveOnly>{}); @@ -96,6 +96,4 @@  assert(l2.get_allocator() == lo.get_allocator());  assert(is_contiguous_container_asan_correct(l2));  } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES  } 
diff --git a/test/std/containers/sequences/vector/vector.cons/initializer_list.pass.cpp b/test/std/containers/sequences/vector/vector.cons/initializer_list.pass.cpp index 408bcc3..edbad8c 100644 --- a/test/std/containers/sequences/vector/vector.cons/initializer_list.pass.cpp +++ b/test/std/containers/sequences/vector/vector.cons/initializer_list.pass.cpp 
@@ -7,6 +7,8 @@  //  //===----------------------------------------------------------------------===//   +// UNSUPPORTED: c++98, c++03 +  // <vector>    // vector(initializer_list<value_type> il); @@ -18,7 +20,6 @@    int main()  { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS  {  std::vector<int> d = {3, 4, 5, 6};  assert(d.size() == 4); @@ -28,7 +29,6 @@  assert(d[2] == 5);  assert(d[3] == 6);  } -#if TEST_STD_VER >= 11  {  std::vector<int, min_allocator<int>> d = {3, 4, 5, 6};  assert(d.size() == 4); @@ -38,6 +38,4 @@  assert(d[2] == 5);  assert(d[3] == 6);  } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS  } 
diff --git a/test/std/containers/sequences/vector/vector.cons/initializer_list_alloc.pass.cpp b/test/std/containers/sequences/vector/vector.cons/initializer_list_alloc.pass.cpp index f4c3b5c..ac5d017 100644 --- a/test/std/containers/sequences/vector/vector.cons/initializer_list_alloc.pass.cpp +++ b/test/std/containers/sequences/vector/vector.cons/initializer_list_alloc.pass.cpp 
@@ -7,6 +7,8 @@  //  //===----------------------------------------------------------------------===//   +// UNSUPPORTED: c++98, c++03 +  // <vector>    // vector(initializer_list<value_type> il, const Allocator& a = allocator_type()); @@ -20,7 +22,6 @@    int main()  { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS  {  std::vector<int, test_allocator<int>> d({3, 4, 5, 6}, test_allocator<int>(3));  assert(d.get_allocator() == test_allocator<int>(3)); @@ -31,7 +32,6 @@  assert(d[2] == 5);  assert(d[3] == 6);  } -#if TEST_STD_VER >= 11  {  std::vector<int, min_allocator<int>> d({3, 4, 5, 6}, min_allocator<int>());  assert(d.get_allocator() == min_allocator<int>()); @@ -42,6 +42,4 @@  assert(d[2] == 5);  assert(d[3] == 6);  } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS  } 
diff --git a/test/std/containers/sequences/vector/vector.cons/move.pass.cpp b/test/std/containers/sequences/vector/vector.cons/move.pass.cpp index d51b364..cd50d54 100644 --- a/test/std/containers/sequences/vector/vector.cons/move.pass.cpp +++ b/test/std/containers/sequences/vector/vector.cons/move.pass.cpp 
@@ -7,6 +7,8 @@  //  //===----------------------------------------------------------------------===//   +// UNSUPPORTED: c++98, c++03 +  // <vector>    // vector(vector&& c); @@ -20,7 +22,6 @@    int main()  { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES  {  std::vector<MoveOnly, test_allocator<MoveOnly> > l(test_allocator<MoveOnly>(5));  std::vector<MoveOnly, test_allocator<MoveOnly> > lo(test_allocator<MoveOnly>(5)); @@ -68,7 +69,6 @@  assert(*j == 3);  assert(is_contiguous_container_asan_correct(c2));  } -#if TEST_STD_VER >= 11  {  std::vector<MoveOnly, min_allocator<MoveOnly> > l(min_allocator<MoveOnly>{});  std::vector<MoveOnly, min_allocator<MoveOnly> > lo(min_allocator<MoveOnly>{}); @@ -98,6 +98,4 @@  assert(*j == 3);  assert(is_contiguous_container_asan_correct(c2));  } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES  } 
diff --git a/test/std/containers/sequences/vector/vector.cons/move_alloc.pass.cpp b/test/std/containers/sequences/vector/vector.cons/move_alloc.pass.cpp index fcdd35a..767a0ce 100644 --- a/test/std/containers/sequences/vector/vector.cons/move_alloc.pass.cpp +++ b/test/std/containers/sequences/vector/vector.cons/move_alloc.pass.cpp 
@@ -7,6 +7,8 @@  //  //===----------------------------------------------------------------------===//   +// UNSUPPORTED: c++98, c++03 +  // <vector>    // vector(vector&& c, const allocator_type& a); @@ -20,7 +22,6 @@    int main()  { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES  {  std::vector<MoveOnly, test_allocator<MoveOnly> > l(test_allocator<MoveOnly>(5));  std::vector<MoveOnly, test_allocator<MoveOnly> > lo(test_allocator<MoveOnly>(5)); @@ -75,7 +76,6 @@  assert(l2.get_allocator() == other_allocator<MoveOnly>(4));  assert(is_contiguous_container_asan_correct(l2));  } -#if TEST_STD_VER >= 11  {  std::vector<MoveOnly, min_allocator<MoveOnly> > l(min_allocator<MoveOnly>{});  std::vector<MoveOnly, min_allocator<MoveOnly> > lo(min_allocator<MoveOnly>{}); @@ -94,6 +94,4 @@  assert(l2.get_allocator() == min_allocator<MoveOnly>());  assert(is_contiguous_container_asan_correct(l2));  } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES  } 
diff --git a/test/std/containers/sequences/vector/vector.cons/op_equal_initializer_list.pass.cpp b/test/std/containers/sequences/vector/vector.cons/op_equal_initializer_list.pass.cpp index 4e5a204..21dd5c3 100644 --- a/test/std/containers/sequences/vector/vector.cons/op_equal_initializer_list.pass.cpp +++ b/test/std/containers/sequences/vector/vector.cons/op_equal_initializer_list.pass.cpp 
@@ -7,6 +7,8 @@  //  //===----------------------------------------------------------------------===//   +// UNSUPPORTED: c++98, c++03 +  // <vector>    // vector& operator=(initializer_list<value_type> il); @@ -19,7 +21,6 @@    int main()  { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS  {  std::vector<int> d;  d = {3, 4, 5, 6}; @@ -30,7 +31,6 @@  assert(d[2] == 5);  assert(d[3] == 6);  } -#if TEST_STD_VER >= 11  {  std::vector<int, min_allocator<int>> d;  d = {3, 4, 5, 6}; @@ -41,6 +41,4 @@  assert(d[2] == 5);  assert(d[3] == 6);  } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS  } 
diff --git a/test/std/containers/sequences/vector/vector.modifiers/emplace_extra.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/emplace_extra.pass.cpp index 7e4aed8..e5e0277 100644 --- a/test/std/containers/sequences/vector/vector.modifiers/emplace_extra.pass.cpp +++ b/test/std/containers/sequences/vector/vector.modifiers/emplace_extra.pass.cpp 
@@ -7,6 +7,8 @@  //  //===----------------------------------------------------------------------===//   +// UNSUPPORTED: c++98, c++03 +  // <vector>    // template <class... Args> iterator emplace(const_iterator pos, Args&&... args); @@ -19,7 +21,6 @@    int main()  { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS  {  std::vector<int> v;  v.reserve(3); @@ -38,7 +39,6 @@  assert(v[0] == 3);  assert(is_contiguous_container_asan_correct(v));  } -#if TEST_STD_VER >= 11  {  std::vector<int, min_allocator<int>> v;  v.reserve(3); @@ -57,6 +57,4 @@  assert(v[0] == 3);  assert(is_contiguous_container_asan_correct(v));  } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS  } 
diff --git a/test/std/containers/sequences/vector/vector.modifiers/insert_iter_initializer_list.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/insert_iter_initializer_list.pass.cpp index b0fe123..9072d42 100644 --- a/test/std/containers/sequences/vector/vector.modifiers/insert_iter_initializer_list.pass.cpp +++ b/test/std/containers/sequences/vector/vector.modifiers/insert_iter_initializer_list.pass.cpp 
@@ -7,6 +7,8 @@  //  //===----------------------------------------------------------------------===//   +// UNSUPPORTED: c++98, c++03 +  // <vector>    // iterator insert(const_iterator p, initializer_list<value_type> il); @@ -19,7 +21,6 @@    int main()  { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS  {  std::vector<int> d(10, 1);  std::vector<int>::iterator i = d.insert(d.cbegin() + 2, {3, 4, 5, 6}); @@ -41,7 +42,6 @@  assert(d[12] == 1);  assert(d[13] == 1);  } -#if TEST_STD_VER >= 11  {  std::vector<int, min_allocator<int>> d(10, 1);  std::vector<int, min_allocator<int>>::iterator i = d.insert(d.cbegin() + 2, {3, 4, 5, 6}); @@ -63,6 +63,4 @@  assert(d[12] == 1);  assert(d[13] == 1);  } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS  } 
diff --git a/test/std/containers/sequences/vector/vector.modifiers/push_back_rvalue.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/push_back_rvalue.pass.cpp index f4a1f5d..ac1fffd 100644 --- a/test/std/containers/sequences/vector/vector.modifiers/push_back_rvalue.pass.cpp +++ b/test/std/containers/sequences/vector/vector.modifiers/push_back_rvalue.pass.cpp 
@@ -7,6 +7,8 @@  //  //===----------------------------------------------------------------------===//   +// UNSUPPORTED: c++98, c++03 +  // <vector>    // void push_back(value_type&& x); @@ -21,7 +23,6 @@    int main()  { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES  {  std::vector<MoveOnly> c;  c.push_back(MoveOnly(0)); @@ -81,7 +82,6 @@  for (int j = 0; static_cast<std::size_t>(j) < c.size(); ++j)  assert(c[j] == MoveOnly(j));  } -#if TEST_STD_VER >= 11  {  std::vector<MoveOnly, min_allocator<MoveOnly>> c;  c.push_back(MoveOnly(0)); @@ -110,6 +110,4 @@  for (int j = 0; static_cast<std::size_t>(j) < c.size(); ++j)  assert(c[j] == MoveOnly(j));  } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES  }